<template>
  <a-row style="padding-top:10px;" v-if="taskLinkupParam.bpmCmTaskInfos.length>0">
    <a-alert :message="i18n('taskComm.commDesc','你正与进行...')" type="info" closeText="关闭" >
      <p slot="description">
      <ul>
        <li v-for="item in taskLinkupParam.bpmCmTaskInfos">
            {{i18n('taskComm.comm','沟通')}}:<span>{{item.cmUserName}}</span>,
          <span v-if="item.opinion==''">
                  <span style="color:red">{{i18n('taskComm.notReply','暂无回复。')}}</span><a-button type="link" icon="edit" @click="revokeCmTask(item.taskId)" size="small">{{i18n('taskComm.withdrawComm','撤回沟通')}}</a-button>
                </span>
          <span v-else>{{i18n('taskComm.reply','回复')}}：{{item.opinion}}</span>
        </li>
      </ul>
      </p>
    </a-alert>
  </a-row>
</template>

<script>
    import BpmtaskApi from "@/api/bpm/core/bpmTask";


    export default {
        name: "task-commu",
        props:{
            taskLinkupParam:{
                type:Object
            }
        },
        methods:{
            i18n(name,text,key){
                return this.$ti18(name,text,"bpmTask",key);
            },
            //撤回沟通任务
            revokeCmTask(taskId){
                let self=this;
                //进行任务撤回处理
                BpmtaskApi.revokeCmTask(taskId).then(resp=>{
                    this.$emit("commuTaskRevoked")
                });
            },
        }
    }
</script>

<style scoped>

</style>